package dao.oc_company_info;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import entitybean.oc_boat_ice.EntityBeanOc_Boat_Ice;
import entitybean.oc_company_info.EntityBeanOc_Company_Info;
import entitybean.oc_friendly_link.EntityBeanOc_Friend_Link;

public class DaoImpl_Oc_Company_Info extends HibernateDaoSupport implements Dao_Oc_Company_Info
{
	public void Insert_Oc_Company_Info(EntityBeanOc_Company_Info e)
	{
		this.getHibernateTemplate().save(e);
	}
	public void Update_Oc_Company_Info(EntityBeanOc_Company_Info e)
	{
		this.getHibernateTemplate().update(e);
	}
	public void Delete_Oc_Company_Info(String id)
	{
		List<EntityBeanOc_Company_Info> list=this.getHibernateTemplate().find("from EntityBeanOc_Company_Info where del='OFF' and id in("+id+")");	
		for(int i=0;i<list.size();i++)
		{
			EntityBeanOc_Company_Info e=list.get(i);
			e.setDel("ON");
			this.getHibernateTemplate().update(e);
			
		}
	}
	@SuppressWarnings("unchecked")
	public List<EntityBeanOc_Company_Info> Find_EntityBeanOc_Company_Info()
	{
		return this.getHibernateTemplate().find("from EntityBeanOc_Company_Info where del='OFF'");
	}
	public EntityBeanOc_Company_Info Find_EntityBeanOc_Company_Info_By_ID(
			Integer id) {
		EntityBeanOc_Company_Info e=new EntityBeanOc_Company_Info();
		List<EntityBeanOc_Company_Info> list=this.getHibernateTemplate().find("from EntityBeanOc_Company_Info where id="+id);
		if(list.size()>0)
		{
			e=list.get(0);
		}
		return e;
	}
}
